﻿<!DOCTYPE html><!-- saved from url=(0048)http://www.gethx.com -->
<html>
<head>
<meta charset="utf-8" />
<title>{$page_seo.title}</title>
<meta name="keywords" content="{$page_seo.keywords}" />
<meta name="description" content="{$page_seo.description}" />
<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" name="viewport">
<script src="__STATIC__/js/jquery/jquery.js"></script>
<script type="text/javascript" src="__STATIC__/weixin/js/index.js"></script>
<link type="text/css" rel="stylesheet" href="__STATIC__/weixin/css/shop.css">
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/css/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/css/font-awesome.css" media="all">
<script src="__STATIC__/layer.m/layer.m.js"></script>
<link rel="stylesheet" href="__STATIC__/layer.m/layer.css">
</head>
<body>

<script>
    function showCover(){
        $(".shade-cover,.cover-text").show();
        $(".cover-close").show();
        $(".cover-jiantou").show();
    }

    function hideCover(){
        $(".shade-cover,.cover-text").hide()
        $(".cover-close").hide();
        $(".cover-jiantou").hide();
    }

    //showCover()

</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
wx.config({
    appId: '{$signPackage.appId}',
    timestamp:{$signPackage.timestamp},
    nonceStr: '{$signPackage.nonceStr}',
    signature: '{$signPackage.signature}',
    jsApiList: [
      'checkJsApi',
      'onMenuShareTimeline',
      'onMenuShareAppMessage',
      'previewImage'
    ]
 });

wx.ready(function () {
    wx.onMenuShareAppMessage({
      title: "早点约我",
      desc: "微社交与本地生活O2O的完美结合——为心爱的人点一份早餐！",
      link: "http://" + window.location.host + '{:u("index/zaodian")}',
      imgUrl: "http://www.bf521.com/static/weixin/images/index/zaodian_logo.png",
      trigger: function (res) {
        //alert('用户点击发送给朋友');
      },
      success: function (res) {
        //window.location.href = '{:u("index/zaodian")}'
      },
      cancel: function (res) {
        //alert('已取消');
      },
      fail: function (res) {
        alert(JSON.stringify(res));
      }
    });
    //alert('已注册获取“发送给朋友”状态事件');
});

</script>

<script charset="utf-8" src="__STATIC__/weixin/js/touchslider.dev.js" type="text/javascript"></script>
<div id="content">
<div class="banner">
    <div id="slider" class="slider" style="overflow: hidden; visibility: visible; list-style: none outside none; position: relative;">
        <ul id="sliderlist" class="sliderlist" style="position: relative; overflow: hidden; transition: left 600ms ease 0s; width: 1800px; left: -1200px;">
        <volist name='img_list' id='img'>
            <li style="float: left; display: block; width: 600px;">
                <span>
                   <a href="#"> <img width="100%" style='height:100px' src="{:attach(get_thumb($img['url'], '_b'), 'item')}"></a>
                </span>
            </li>
        </volist>
      
        </ul>
        <div id="pagenavi">
         <volist name='img_list' id='vo' key='k' >
           <a <if condition='$k eq 1'>class="active"</if> href="javascript:void(0);">{$k}</a>
        </volist>
        
        </div>
    </div>
</div>
<script>
$(function(){
    var active=0,
    as=document.getElementById('pagenavi').getElementsByTagName('a');
    for(var i=0;i<as.length;i++){
        (function(){
            var j=i;
            as[i].onclick=function(){
                t2.slide(j);
                return false;
            }
        })();
    }
    var t2=new TouchSlider({id:'sliderlist', speed:600, timeout:3000, before:function(index){
        as[active].className='';
        active=index;
        as[active].className='active';
    }});
    $('#sliderlist img').height($('#sliderlist li').width() * 0.5)
})

function add_cart(href)//商品ID，购买数量
{ 
    var spec = $("#speca").val();
    var goodId = $("#goodId").val();
    var quantity = $("#quantity").val();

    var url  = "{:u('shopcart/add_cart')}";
    $.post(url,{goodId:goodId,spec:spec,quantity:quantity},function(data){
        
        if(data.status==1)
        {   
            window.location.href = href
            $('.dialog_title').html(data.msg);
            $('.bold_num').text(data.count);
             $('.bold_mly').html(data.sumPrice);
             $('.ware_cen').slideDown('slow');
             setTimeout(slideUp_fn, 5000);

        }else
        {
            $('.dialog_title').html(data.msg);
            $('.bold_num').text(data.count);
             $('.bold_mly').html(data.sumPrice);
             $('.ware_cen').slideDown('slow');
             setTimeout(slideUp_fn, 5000);
        }
    },'json');  
    return true;
}
    
</script>
<input id="speca" type="hidden" value="<php>if($color_ids_arr1[0]){</php>{$color_ids_arr1[0]}<php>}</php><php>if($size_ids_arr1[0]){</php><nobr>{$size_ids_arr1[0]}</nobr><php>}</php>" />
<input type="hidden" value="{$item.id}" id="goodId" >
<input type="hidden" value="1" id="quantity" >


<div class="ware_info mt10">
    <div class='good_content' style='margin:10px'>
        <input type="hidden" value="{$item.id}" id="goodId" >
        <span class='title'>{$item.title}</span>
        <span class='price'>¥{$item.price}</span>
        <span class='storage'>剩余{$item.goods_stock}份</span>
    </div>
    <style>
        .option_box .tline{
            background-image: url("/static/weixin/images/index/point_line.png");
            background-repeat: no-repeat;
            background-size: 100% 2px;
            background-position: center;
            color:white;
            text-align:center;
        }

        .option_box .tline img{width:20%;}

        .pay_box{
            background-image: url("/static/weixin/images/index/pay_bg.png");
            background-repeat: no-repeat;
            background-size: 100% 100%;
            background-position: center;
            color:white;
            width:100%;
            position:fixed;
            bottom:0px;
        }

        .pay_box .send-btn{
            border:2px solid white;
            border-radius: 5px;
            padding:5px 10px;
            font-weight:bold;
            margin-top:15px;
            margin-right:10px;
            color:white;
        }
    </style>
    <div class="option_box">
        <if condition="$item['is_zaodian']">
        <div class='tline'><img src="__STATIC__/weixin/images/index/week_plan.png" alt=""></div>
        </if>
        <div class="default">
        {$item.info}
        </div>
    </div>
    <div class="clear" style='height:100px'>&nbsp;</div>


    <!-- <div class="ware_text"> -->
    <!-- <ul class="ware_btn">
        <li onClick="javascript:buys();" title="立刻购买" class="enter">立刻购买</li>
    </ul> -->
    <div class="pay_box left">
        <span class='inline-block pt10 pb5 pl5'><if condition="$item['is_zaodian']">餐费<else/>价格</if>:{$item.price}元 运费:{$item.kuaidi}元<br>合计:<php>echo $item['price']+$item['kuaidi']</php>元</span>
        
        <a class='inline-block send-btn right' onclick="add_cart('{:u('order/jiesuan?type=songwo')}')">送&nbsp;&nbsp;我</a>
        <a class='inline-block send-btn right' onclick="add_cart('{:u('order/jiesuan?type=wosong')}')">我&nbsp;&nbsp;送</a>
        
    </div>
    
        <div class="clear"></div>
    <!-- </div> -->
    
</div>



<script>
wx.ready(function(){
var srcList = [];
$.each($('.default img'),function(i,item){
   if(item.src) {
       srcList.push(item.src);
       $(item).click(function(e){
           // 通过这个API就能直接调起微信客户端的图片播放组件了
           wx.previewImage({current:this.src,urls:srcList});
       });
   }
});
});
</script>



<script language="javascript">
var resultObj = {} , selectObj = {};		
function change(span){		
if(selectObj[span.getAttribute('name')]){
selectObj[span.getAttribute('name')].className = "unchecked";
selectObj[span.getAttribute('name')].checked = false;
}
span.className = "checked";
span.checked = true;
selectObj[span.getAttribute('name')] = span;
resultObj[span.getAttribute('name')] = span.innerHTML;
select();
}
function select(){						
var html = '';					
for(var i in resultObj){
if(resultObj != ''){
	html +=  resultObj[i];
}
}
html = html.slice(0,html.length);

document.getElementById('speca').value = html;
}
window.onload = function(){
var spanArray = document.getElementsByTagName("span");
for(var i, len = spanArray.length; i < len; i++){
if(!spanArray[i].id){
spanArray[i].onclick = function(){
change(this);
}
}
}
}

$(".default img").each(function(i){
    if($(this).width() > $(window).width()){
        $(this).css('width',"100%");
        $(this).css('height',"auto");
    }
})
</script>
</body>
</html>